package com.rainbow.support.action.log.util;

import com.google.gson.JsonElement;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

import java.time.Instant;

/**
 * GSON序列化实体类中Instant时,针对性处理工具
 * @author rainbow
 */
public class InstantJson implements JsonSerializer<Instant> {
    @Override
    public JsonElement serialize(Instant src, java.lang.reflect.Type typeOfSrc, JsonSerializationContext context) {
        return new com.google.gson.JsonPrimitive(src.toString());
    }
}


